package com.edu.juc;

import java.util.Arrays;
import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int n = scan.nextInt();
        int m = scan.nextInt();

        int[] d = new int[m];
        int[] p = new int[m];

        for (int i = 0; i < m; i++) {
            d[i] = scan.nextInt();
        }
        for (int i = 0; i < m; i++) {
            p[i] = scan.nextInt();
        }

        int[] c = new int[n];

        for (int i = 0; i < n; i++) {
            c[i] = scan.nextInt();
        }

        ///

        int[][] jobs = new int[m][2];
        for (int i = 0; i < m; i++) {
            jobs[i][0] = d[i];
            jobs[i][1] = p[i];
        }

        Arrays.sort(jobs, (a, b) -> a[0] - b[0]);
//        Arrays.sort(jobs, Comparator.comparingInt(a -> a[0]));
        Arrays.sort(c);

        long total = 0;

        int maxScore = 0;
        for (int i = 0; i < n; i++) {
            int ability = c[i];
            int j = 0;
            while (j < m && jobs[j][0] <= ability) {
                maxScore = Math.max(maxScore, jobs[j][1]);
                j++;
            }
            total += maxScore;
        }
        System.out.println(total);
    }
}
